const Koa = require('koa')
const app = new Koa()
const cors = require('koa2-cors')
const bodyParser = require('koa-bodyparser')
const static = require("koa-static")
const path = require('path')

// 路由
const index = require('./routes')
const pinduoduo = require('./routes/pinduoduo')

app
.use(cors())
.use(bodyParser())
.use(static(
  path.join( __dirname,  'public')
))
.use(index.routes(), index.allowedMethods())
.use(pinduoduo.routes(), pinduoduo.allowedMethods())
.listen(6000)
console.log('天猫取图助手已开启，本地端口服务地址：http://localhost:6000')